package com.healthcloud.service.impl;


import com.healthcloud.dao.IntegralDetailMapper;
import com.healthcloud.entity.IntegralDetail;
import com.healthcloud.service.IntegralDetailService;
import com.healthcloud.utils.DateUtils;
import com.healthcloud.utils.PageParam;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author zhangjie
 */
@Service
public class IntegralDetailServiceImpl implements IntegralDetailService {

    @Resource
    private IntegralDetailMapper integralDetailMapper;

    @Override
    public List<IntegralDetail> queryBySnToday(String sn) {
        return integralDetailMapper.queryBySnToday(sn);
    }
    @Override
    public List<IntegralDetail> queryBySnAndTestTime(String sn, Date testTime) {
        return integralDetailMapper.queryBySnAndTestTime(sn,DateUtils.format(testTime, DateUtils.DATE_PATTERN));
    }

    @Override
    public void save(IntegralDetail detail) {
        integralDetailMapper.save(detail);
    }

    @Override
    public List<IntegralDetail> listByMasterId(Integer masterId, PageParam pageParam) {
        return integralDetailMapper.listByMasterId(masterId, pageParam);
    }

    @Override
    public Integer countByMasterId(Integer masterId) {
        return integralDetailMapper.countByMasterId(masterId);
    }
}
